var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
page.customHeaders = {
  "X-Test": "foo"
  ,"DNT": "1"
  ,"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
  ,"Referer": "https://www.toutiao.com"
};

page.onInitialized = function() {
  page.customHeaders = {};
};

/*phantom.addCookie({
/*  'name'     : 'Valid-Cookie-Name',   /* required property */
/*  'value'    : 'Valid-Cookie-Value',  /* required property */
/*  'domain'   : 'localhost',
/*  'path'     : '/foo',                /* required property */
/*  'httponly' : true,
/*  'secure'   : false,
/*  'expires'  : (new Date()).getTime() + (1000 * 60 * 60)   /* <-- expires in 1 hour */
/*});
*/
page.open('https://www.toutiao.com?wid_try=1', function(status) {
    if(status === "success"){
        //page.render('z.png');
        console.log(page.content);
    }
    phantom.exit();
});